<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="shouye.css">
</head>
<body>
<?php
session_start();
$user =@$_SESSION['username'];
if(!$user)
{
    echo "<script language='JavaScript'>location.href='page.php';alert('您还没有登录,请先登录');</script>";
    exit();
}

$conn = @mysqli_connect("localhost","root","","abcd");
if (!$conn){
    die("连接数据库失败：" . mysqli_error());
}
?>
<div id="daohang">
    <ul>
        <li><a href="personal.php">个人主页</a></li>
        <li><a href="page.php">精选</a></li>
        <li><a href="">主页</a></li>
    </ul>
</div>

<div id="top_1"  style="background: url('img/2016-08-13_165438.jpg') no-repeat;background-size: cover">
    <p>论坛首页</p>
</div>
<div id="top_2">

    <div style="position: absolute;right: 0;top: 0;text-align: right">
        您已经登录成功，也可以<a href="zhuxiao.php" style="background-color: aquamarine">退出登录</a><br/>
        您也可以<a href="xiugai.php">修改</a>账户资料
    </div>
    
</div>
<div style="width: 100px;height: 100px;line-height: 100px;text-align: center;
border-radius: 5px 60px;position: absolute;top: 250px;background-color: #c167bf">
    <a href="chakangonggao.php" style="color: #f4f3f2">查看公告</a>
</div>
<div id="body_1">
    <ul style="width:1000px;background-color: aquamarine;margin: 0 auto">
        <li class="liOne">
            <p></p>
            <ul style="border-top: 3px solid #AC2F0B">
                <li>
                    <a href="fenye_1.php?ad=1">古典文献</a>
                    <br/>
                    <span>主题数：<?php
                        $result=mysqli_query($conn,"select * from message WHERE type=1");
                        $count = mysqli_num_rows($result);
                        echo $count;
                        ?></span>
                    <span>帖数：<?php echo $count;?></span>
                    <br/>
                    <span>发表人数<?php
                        $re=mysqli_query($conn,"select distinct (user) from message where type=1");
                        $co = mysqli_num_rows($re);
                        echo $co;
                        ?></span>
                </li>
                <li>
                    <a href="fenye_1.php?ad=2">体育新闻</a>
                    <br/>
                    <span>主题数：<?php
                        $resultT=mysqli_query($conn,"select * from message WHERE type=2");
                        $countT = mysqli_num_rows($resultT);
                        echo $countT;
                        ?></span>
                    <span>帖数：<?php echo $countT;?></span>
                    <br/>
                    <span>发表人数<?php
                        $reT=mysqli_query($conn,"select distinct (user) from message WHERE  type=2 ");
                        $coT = mysqli_num_rows($reT);
                        echo $coT;
                        ?></span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：3</span>
                    <span>帖数：3</span>
                    <br/>
                    <span>发表人数3</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：3</span>
                    <span>帖数：3</span>
                    <br/>
                    <span>发表人数3</span>
                </li>
            </ul>
        </li>
        <li class="liOne">
            <ul>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
            </ul>
        </li>
        <li class="liOne">
            <ul>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
            </ul>
        </li>
        <li class="liOne">
            <ul>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
            </ul>
        </li>
        <li class="liOne">
            <ul>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
            </ul>
        </li>
        <li class="liOne">
            <ul>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
                <li>
                    <a href="fenye_1.php">古典文献</a>
                    <br/>
                    <span>主题数：</span>
                    <span>帖数：</span>
                    <br/>
                    <span>发表人数</span>
                </li>
            </ul>
        </li>
    </ul>
</div>
<div id="footbody">

</div>
</body>

</html>